All Questions
Tagged with query-postsorder
36 questions
0votes
1answer
70views
new WP_Query with order args – no more distinction between categories
I try to change the post order on all of my category/archive pages from the WP standard to having them sorted by their modified date. I modified a part of the loop.php from my theme (derived from ...
0votes
1answer
291views
query posts custom field calculation value
I have a front-end form whereby users create a post and input 3 numerical custom field value` as part of their post. These 3 custom fields are then calculated and the result is displayed in the post....
0votes
1answer
14views
Order by meta date with a thousanth of a second defaults to post order
I have a custom post type query: $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; $args = array( 'paged' => $paged, 'post_type' => 'my_custom_post_type', '...
2votes
2answers
70views
Ordering terms before displaying posts
My question is close to other questions, but I dont' have enough reputation to comment. I'm working for a restaurant and I 'd like, for my menu page, to organise my posts "meal" under terms "...
2votes
1answer
3kviews
Display custom post types with custom date field value (before today) & order by custom date field
I'm trying to display custom post types with custom date field value being before today. It works OK for showing posts before today, but the order is only based on post date. I want to have the result ...
1vote
1answer
126views
How can I pick a single post from the latest 3?
I'm looking to display a single featured post from my latest 3 posts at random. I've managed to get it up and running picking any post at random just fine, but I want to filter it down to only the ...
0votes
1answer
425views
Wordpress query reverse order
$args = array('post_type' => 'etlap', 'posts_per_page' => 5, 'post__in' => $ids, 'post_status' => 'any', 'orderby' => 'post__in'); I want to make the orderby status reversed. How is it ...
0votes
0answers
70views
How to order posts, that have already been filtered by custom taxonomy, by their category names?
My question is not a duplicate, because in my case posts have already been sorted by custom taxonomy term. The question is how to order posts by their category name AFTER they have been sorted by ...
4votes
1answer
2kviews
Order post by year DESC and month ASC
I have a worpresss 4.0.12 website; i created a custom template category-$id.php in which I have to show post ordering them by Year DESC and by month ASC (or a custom field ASC), the result should be ...
0votes
1answer
1kviews
Custome column sort by date not title
I've created a custom column. Currently they are automatically sorting by title however i want them to sort by date. I've tried adding a "query_post" like: query_posts('&post_type=project&...
0votes
0answers
663views
Order posts by ACF checkbox
I would like to order the posts (archive.php) by listing the ones with the ACF checkbox "Premium" first, could someone please offer some advice?:) This is what I've tried so far: <?php echo ...
1vote
3answers
4kviews
List posts in alphabetical order
What I'm trying to achieve is to set the list shown in alphabetical order. Any thoughts on how i can successfully achieve this? I have pasted the snippet below for reference. <ul ...
1vote
1answer
317views
Order posts by condition
I need to get 15 posts. If there are any with a tag featured, I want them to be first. If there are none, I want the rest to be random posts. My idea was to sort posts based on a condition tag=...
0votes
2answers
13kviews
ascending order custom post type
I'm trying to sort a custom post type in ascending order (instead of the default descending). Registering the post type like so: function codex_custom_init() { register_post_type( 'calendar', ...
0votes
0answers
110views
query_posts with sorting on a custom datestamp
I have a custom meta field that I want to use to sort with query_posts but its not ordering my posts properly since it is a datestamp (i.e. 04/21/2014) and its treating it like a normal text string. ...